<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'industrycost.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link rel="stylesheet" type="text/css" href="<%=basePath%>/css/biaoge.css"/>
    <script type="text/javascript" src="jquery/js/jquery-1.8.2.js"></script>
     <script type="text/javascript" src="<%=basePath%>/My97DatePicker/WdatePicker.js"></script>
    <style type="text/css">
     .td{
      text-align: center;
     }
    </style>
  </head>
  <script type="text/javascript">
  function chaxun(){
     var time1=$("#time1").val().trim();
     var time2=$("#time2").val().trim();
     var indusname=$("#indusname").val().trim();
     var dingid=$("#dingid").val().trim();
     var dingzhuti=document.getElementById("dingzhuti").value;
    if(time2!=""&&time2!=null){
     if(time1==""||time1==null){
       alert("前者时间不能为空");
     }
     else{
 window.location="induscostByDateAndName?orderid="+dingid+"&&ordername="+dingzhuti+"&&indusname="+indusname+"&&time1="+time1+"&&time2="+time2;
     }
     }
     
     else{
window.location="induscostByDateAndName?orderid="+dingid+"&&ordername="+dingzhuti+"&&indusname="+indusname+"&&time1="+time1+"&&time2="+time2;     
     }
   }
    
     function kai(a){
   var k=document.getElementById("zuihou");
  if(a<=1) k.innerHTML="这已经第一页了";
  }
  function zui(a,b){
  var z=document.getElementById("zuihou");
  if(a>=b) z.innerHTML="这已经是最后一页了";
  }
  </script>
  <body>
  <div style="margin-left: 200px;">
  <!-- <div style="float: right;margin-top: -80px">  -->
  <table>
  <tr>
  <td style="margin: 0">
 <div style="margin: 30px 30px 15px;">
      订单编号：<input type="text" id="dingid"> 订单主题<input type="text" id="dingzhuti"> 工厂名称：<input type="text" id="indusname"><br/>
      日期查询：<input type="text" id="time1" class="Wdate" onFocus="WdatePicker({maxDate:'#F{$dp.$D(\'time2\')||\'2020-10-01\'}'})"/>至<input type="text" id="time2" class="Wdate" onFocus="WdatePicker({minDate:'#F{$dp.$D(\'time1\')}',maxDate:'2020-10-01'})"/><input type="button" value="查询" onclick="chaxun()">
  </div>
  </td>
  </tr>
  <tr>
  <td style="margin: 0">
   <!--  <div style="margin-left:100px;margin-top:100px"> -->
   <div style="margin:0px 30px;">
    <font size="4" color="red" style="margin-left: 300;">昨天一天的订单</font>  
    <font size="4" color="red" style="margin-left: 650">所有成本总额为:${alltotal}</font>
    <table id="mytable" cellspacing="2" class="td">
     <tr><td>订单编号</td><td>订单名称</td><td>对应工厂</td><td>下单时间</td> <td>各项成本</td> <td>订单总额</td></tr>
     <c:forEach items="${induscostlist}" var="costli">
     <tr>
     <td>${costli.dingid}</td>
     <td>${costli.ordername}</td>
     <td>${costli.industryname}</td>
     <td><fmt:formatDate value="${costli.datetime}" pattern="yyyy-MM-dd hh:mm:ss" /></td>
     <td>
      <c:if test="${! empty costli.jiagongcostname}">
      ${costli.jiagongcostname}:${costli.jiagongcost} 
      </c:if>
      
       <c:if test="${! empty costli.jiguangcostname}">
      ${costli.jiguangcostname}:${costli.jiguangcost}
       </c:if>
       
       <c:if test="${! empty costli.zhizuogongyicostname}"> 
      ${costli.zhizuogongyicostname}:${costli.zhizuogongyicost} 
       </c:if>
       <c:if test="${! empty costli.yinshuacostname}">
      ${costli.yinshuacostname}:${costli.yinshuacost} 
       </c:if>
       
       <c:if test="${! empty costli.fangdaosuocostname}">
      ${costli.fangdaosuocostname}:${costli.fangdaosuocost}
       </c:if>
       
       <c:if test="${! empty costli.kaoqicostname}"> 
      ${costli.kaoqicostname}:${costli.kaoqicost} 
       </c:if>
       
       <c:if test="${! empty costli.fangzhengdiancostname}">
      ${costli.fangzhengdiancostname}:${costli.fangzhengdiancost}
       </c:if>
       
       <c:if test="${! empty costli.luosicostname}">
      ${costli.luosicostname}:${costli.luosicost}
      </c:if>
      </td> 
     <td>${costli.total}</td></tr>
     </c:forEach> 
    </table>
    </div>
     <div style="margin-left: 350px;margin-top:50px">
 <a href="allindusYesterdaycost?page=1"> 首页</a>&lt;<a href="allindusYesterdaycost?page=${pagenow-1}" onclick="kai(${pagenow})">上一页</a>
							<strong>第${pagenow}页/共${pagecount}页</strong>
							<a href="allindusYesterdaycost?page=${pagenow+1}" onclick="zui(${pagenow},${pagecount})"> 下一页</a>&gt;
							<a href="allindusYesterdaycost?page=${pagecount}">末页</a>&gt;&gt;
					<br>
						<font size="2" color="red" id="zuihou"></font>
						</div>
				</td>
				</tr>
		</table>
    </div>
  </body>
</html>
